package com.test.spring.annotation.service;

import com.test.spring.annotation.repository.UserRepository;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Qualifier;
import org.springframework.stereotype.Service;

/**
 * @author lzy
 * @version v1.0
 * Create DateTime: 2018/9/27 9:42
 */
@Service
public class UserService {
    private UserRepository userRepository;

    @Autowired
    public void setRepository(@Qualifier("repository") UserRepository userRepository) {
        this.userRepository = userRepository;
    }

    public void add() {
        System.out.println("UserService add()...");
        userRepository.save();
    }
}
